package com.turato.json.myjson.demo;

import com.turato.json.model.bo.StudentBO;
import com.turato.json.myjson.JsonObject;
import com.turato.json.myjson.MyJson;
import com.turato.json.myjson.StringUtils;
import org.junit.Before;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tuhao
 * @date 2020/11/25 5:27 下午
 * @desc
 */
public class MyJsonDemo {

    StudentBO studentA = new StudentBO();
    StudentBO studentB = new StudentBO();
    StudentBO studentC = new StudentBO();
    StudentBO studentD = new StudentBO();
    private List<StudentBO> studentBOList = new ArrayList();

    @Before
    public void initTest() {
        studentA.setId(1);
        studentA.setAge(20);
        studentA.setName("Tom");
        studentA.setClassId(1);
        studentA.setScore(100);
        studentA.setHeight(175);
        studentA.setWeight(60);

        studentB.setId(2);
        studentB.setAge(19);
        studentB.setName("Ken");
        studentB.setClassId(2);
        studentB.setScore(60);
        studentB.setHeight(180);
        studentB.setWeight(60);

        studentC.setId(3);
        studentC.setAge(19);
        studentC.setName("Bob");
        studentC.setClassId(2);
        studentC.setScore(70);
        studentC.setHeight(175);
        studentC.setWeight(80);

        studentBOList.add(studentA);
        studentBOList.add(studentB);
        studentBOList.add(studentC);
        studentBOList.add(studentD);
    }

    @Test
    public void testMyJson () {

//        String stringStudentA = "{\"id\":4,\"name\":\"cat\"}";
        String stringStudentA = "{\"id\":4,\"name\":\"cat\"}";
        JsonObject jsonObject = MyJson.parseJsonObject(stringStudentA);
    }
}
